//
//  WelcomeViewController.swift
//  FunSeeker
//
//  Created by 王泽宇 on 2017/3/25.
//  Copyright © 2017年 edu.Tongji.sse. All rights reserved.
//

import UIKit

class WelcomeViewController: UIViewController {
    @IBOutlet weak var beginButton: UIButton!

    @IBAction func clickEnter(_ sender: UIButton) {
        self.enterMain()
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        beginButton.layer.cornerRadius = 28
        beginButton.layer.shadowOpacity = 0.8
        beginButton.layer.shadowColor = UIColor.black.cgColor
        beginButton.layer.shadowOffset = CGSize(width: 2, height: 2)
        
        // Do any additional setup after loading the view.
    }
    
    override func viewDidAppear(_ animated: Bool) {
        let _ = Timer.scheduledTimer(timeInterval: 3, target: self, selector: #selector(WelcomeViewController.enterMain), userInfo: nil, repeats: false)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    func enterMain() {
        let mtc = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "MainTabBar")
        self.present(mtc, animated: true, completion: nil)
    }
}
